<!--
 * @Author: HeAo
 * @Date: 2021-10-08 15:06:55
 * @LastEditTime: 2021-10-08 16:37:52
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2103code\3-2-Vue\day01\3-vue模板语法.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>再见Vue</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
</head>

<body>
  <div id="app">
    {{msg}} <br>
    {{msg + boolean}} <br>
    {{boolean? msg: 'null'}}
    <div title="title" id="one">div</div>
    <div v-bind:title="title" id="one">div2</div>
    <div :title="title" :data-msg="msg">div3</div>
    <button v-on:click="clickHandler">修改数据</button>
    <button @click="clickHandler">修改数据2</button>
    <button @click="msg = 'hello v-on'">修改数据3</button>
    <div v-html="htmlCode">

    </div>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello vue',
        boolean: false,
        title: 'hello v-bind',
        htmlCode: `<div>
                      <h1>h1</h1>
                      <h2>h2</h2>
                      <h3>h3</h3>
                      <h4>h4</h4>
                      <h5>h5</h5>
                    </div>`
      },
      methods: {
        findAllCategories() {
          console.log('查询所有栏目信息');
        },
        clickHandler() {
          this.msg = 'hello v-on'
        }
      },
      created() {
        this.findAllCategories()
      }
    })
  </script>
</body>

</html>